package com.sky.controller.user;

import com.sky.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController(value = "userShopController")
@RequestMapping("/user/shop")
public class ShopController {
    private static final String key="SHOP_STATUS";
    @Autowired
    private RedisTemplate<Object,Object> redisTemplate;

    /**
     * 查询店铺状态
     * @return
     */
    @GetMapping("/status")
    public Result<Integer> getStatus(){
        Object object = redisTemplate.opsForValue().get(key);
        Integer status= (Integer) object;
        return Result.success(status);
    }
}
